//
//  GQHOrderModel.h
//  Xanthium
//
//  Created by GuanQinghao on 23/03/2018.
//  Copyright © 2018 GuanQinghao. All rights reserved.
//

#import "GQHBaseModel.h"

@class GQHContractPaymentModel;

@interface GQHOrderModel : GQHBaseModel

/// 订单ID
@property (nonatomic, copy) NSString *qh_orderID;
/// 订单编号
@property (nonatomic, copy) NSString *qh_orderNumber;

/// 确认装车(司机)
@property (nonatomic, copy) NSString *qh_driverLoadedTime;
/// 确认送达(司机)
@property (nonatomic, copy) NSString *qh_driverUnloadedTime;
/// 确认协议(司机)
@property (nonatomic, copy) NSString *qh_driverContractTime;
/// 确认收货(货主)
@property (nonatomic, copy) NSString *qh_ownerUnloadedTime;
/// 取消时间
@property (nonatomic, copy) NSString *qh_cancelTime;
/// 订单状态
@property (nonatomic, copy) NSString *qh_orderState;
/// 评价状态
@property (nonatomic, copy) NSString *qh_orderReviewState;// 货主评价司机
/// 评价状态
@property (nonatomic, copy) NSString *qh_orderReviewedState;// 司机评价货主
/// 开票状态
@property (nonatomic, copy) NSString *qh_invoiceState;
/// 附件
@property (nonatomic, copy) NSString *qh_attachment;
/// 大文本ID
@property (nonatomic, copy) NSString *qh_largeTextID;

/// 协议ID
@property (nonatomic, copy) NSString *qh_contractID;
/// 报价ID
@property (nonatomic, copy) NSString *qh_qutationID;
/// 公里数
@property (nonatomic, assign) CGFloat qh_mileage;
/// 货物重量
@property (nonatomic, assign) CGFloat qh_freightWeight;
/// 收货人
@property (nonatomic, copy) NSString *qh_consignee;
/// 收货人电话
@property (nonatomic, copy) NSString *qh_consigneeMobile;
/// 收货时间
@property (nonatomic, copy) NSString *qh_consigningTime;

/// 预付款
@property (nonatomic, copy) NSString *qh_contractPrepaymentSum;
/// 尾款
@property (nonatomic, copy) NSString *qh_contractFinalPaymentSum;
/// 其他费用
@property (nonatomic, copy) NSString *qh_contractOtherExpenseSum;
/// 总金额
@property (nonatomic, copy) NSString *qh_amount;

/// 货源ID
@property (nonatomic, copy) NSString *qh_freightID;
/// 起始地行政编码
@property (nonatomic, copy) NSString *qh_departureID;
/// 起始地经度
@property (nonatomic, copy) NSString *qh_departureLatitude;
/// 起始地纬度
@property (nonatomic, copy) NSString *qh_departureLongitude;
/// 起始地
@property (nonatomic, copy) NSString *qh_departure;
/// 目的地行政编码
@property (nonatomic, copy) NSString *qh_destinationID;
/// 目的地经度
@property (nonatomic, copy) NSString *qh_destinationLatitude;
/// 目的地纬度
@property (nonatomic, copy) NSString *qh_destinationLongitude;
/// 目的地
@property (nonatomic, copy) NSString *qh_destination;
/// 货源需求车型
@property (nonatomic, copy) NSString *qh_modelWanted;
/// 货源需求车长
@property (nonatomic, copy) NSString *qh_lengthWanted;
/// 装车时间
@property (nonatomic, copy) NSString *qh_loadingTime;
/// 货物类型
@property (nonatomic, copy) NSString *qh_freightType;
/// 货物类型编码
@property (nonatomic, copy) NSString *qh_freightTypeCode;

/// 司机ID
@property (nonatomic, copy) NSString *qh_driverID;
/// 司机姓名
@property (nonatomic, copy) NSString *qh_driverName;
/// 司机头像
@property (nonatomic, copy) NSString *qh_driverAvatar;
/// 司机手机号
@property (nonatomic, copy) NSString *qh_driverMobile;
/// 司机评分
@property (nonatomic, assign) CGFloat qh_driverScore;
/// 车型编码
@property (nonatomic, copy) NSString *qh_modelCode;
/// 车型
@property (nonatomic, copy) NSString *qh_model;
/// 车辆标准车长
@property (nonatomic, copy) NSString *qh_normalLength;
/// 车辆标准载重
@property (nonatomic, copy) NSString *qh_normalLoading;
/// 车牌号
@property (nonatomic, copy) NSString *qh_licensePlateNumber;

/// 货主ID
@property (nonatomic, copy) NSString *qh_ownerID;
/// 货主头像
@property (nonatomic, copy) NSString *qh_ownerAvatar;
/// 货主姓名
@property (nonatomic, copy) NSString *qh_ownerName;
/// 货主电话
@property (nonatomic, copy) NSString *qh_ownerMobile;
/// 货主评分
@property (nonatomic, assign) CGFloat qh_ownerScore;
/// 货主类型
@property (nonatomic, copy) NSString *qh_ownerType;

/// 预付款
@property (nonatomic, strong) NSArray<GQHContractPaymentModel *> *qh_contractPrepayment;
/// 尾款
@property (nonatomic, strong) NSArray<GQHContractPaymentModel *> *qh_contractFinalPayment;
/// 其他费用
@property (nonatomic, strong) NSArray<GQHContractPaymentModel *> *qh_contractOtherExpense;

/**
 private String id;
 private String waybillAwb;//运单号
 private String waybillState;//运单状态
 private String confirmLoadTime;//确认装车时间  司机确认装车
 private String confirmUnloadTime;//确认卸货时间  司机确认卸货提交回单
 private String affProTime;//司机确认协议时间
 private String shiComTime;//货主确认收货时间
 private String cancelTime;//取消时间
 private String attachment;//附件
 private String evaluateState;//评价状态 01 是  02 否
 private String largeTextId;//大文本ID
 
 private String waybillAgId;//运单协议ID  收货人、总金额、业务类型、运输方式
 private String quotationId;//报价id 对应报价表主键id
 private BigDecimal mileage;//里程 由起始地和目的地坐标在地图中计算得出
 private BigDecimal demandVehicle;//货物重量
 private String consignee;//收货人
 private String consigneePhone;//收货人电话
 private String goodsTime;//收货时间
 
 private String freightPrepaidSum;//预付款
 private String freifhtTailedSum;//尾款
 private String otherExpensesSum;//其它费用
 private String amount;//总金额
 
 private String goodsSupplyId;//货源ID 获取到货源信息 起始地、目的地
 private String startPlace;//起始地
 private String endPlace;//目的地
 private String demandModels;//需求车型
 private String demandVehicleLength;//需求车长
 private String goodsType;//货物类型
 private String loadingTime;//装车时间
 
 private String driverId;//司机ID  用户ID、司机认证信息
 private String driverPhone;//司机电话
 private String DriveName;//司机姓名
 private Double driveScore;//司机评分
 private String driverHeadImage;//司机头像
 private String licPlateNum;//车牌号
 private String vehicleclassificationcode;//车型     列表选择，参照代码集，表4 就是车辆分类代码
 private String carLength;//车长  列表
 private String carLoad;//载重
 
 private String ownerId;//货主ID
 private String ownerPhone;//货主电话
 private String ownerName;//货主姓名
 private Double ownerScore;//货主评分
 private String ownerHeadImage;//货主头像
 private String ownerType;//货主类型
 
 "id": "2c9b808f62af37e60162af3a06b50000",
 "waybillAwb": "KJJTWLZX20180410190358101",
 "waybillState": "11",
 "confirmLoadTime": "2018-04-12 18:53:45",
 "confirmUnloadTime": "2018-04-13 09:19:57",
 "affProTime": "2018-04-10 19:03:58",
 "shiComTime": null,
 "cancelTime": null,
 "attachment": null,
 "evaluateState": "02",
 "largeTextId": null,
 
 "waybillAgId": "4028b881627b535d01627b89daed0023",
 "quotationId": "4028b881627b535d01627b76f353001b",
 "mileage": 320,
 "demandVehicle": 30,
 "consignee": "收货人A",
 "consigneePhone": "12322221111",
 "goodsTime": "2018-11-12",
 
 "freightPrepaidSum": "45.0",
 "freifhtTailedSum": "90.0",
 "otherExpensesSum": "40.0",
 "amount": "175.0",
 
 "goodsSupplyId": "4028b881627b535d01627b6e93dc0014",
 "startPlace": "石家庄市 高邑县",
 "endPlace": "邯郸市 鸡泽县",
 "demandModels": "仓栅式货车",
 "demandVehicleLength": "17米",
 "goodsType": "电子产品",
 "loadingTime": "2018-03-31 12:38:22",
 
 "driverId": "4028b881627b535d01627b62b96b000a",
 "driveName": "司机11"
 "driverPhone": "18792684152",
 "driveScore": 4.5,
 "driverHeadImage": "4228c1a2692b4465899021eb76b161eb.jpg",
 "licPlateNum": "lic006",
 "vehicleclassificationcode": "普通货车",
 "carLength": "",
 "carLoad": "30",
 
 "ownerId": "4028b881627ab35a01627b19a03a0002",
 "ownerPhone": "18792684151",
 "ownerName": "任旭庚",
 "ownerScore": 4.5,
 "ownerHeadImage": "afbb0c4c913642e99505bf2762c817c1.jpg",
 "ownerType": "货主",
 
 
 
 "id": "40284774635e8482016361632ef60063",
 "quotationId": "40284774635e84820163615d4a280048",
 "waybillAwb": "KJJTWLZX20180515108",
 "goodsSupplyId": "40284774635e84820163615c4f5c0046",
 "driverId": "4028b88163481a67016348d5dcba000c",
 "waybillAgId": "40284774635e8482016361609ebf0058",
 "largeTextId": "4028472762d634860162d76e59650006",
 "waybillState": "20",
 "attachment": "de65ebdd-b42e-4195-9628-1c5c52c363e8.png,b90718a5-8bfb-4579-b1e6-51fba50fbddf.png,9b4763f9-7525-4035-935a-5d5d1e1a4d88.png,67bb1867-8b45-473e-acec-30823c7bc0dd.png",
 "mileage": 1000,
 "confirmLoadTime": "2018-05-15 09:21:30",
 "confirmUnloadTime": "2018-05-15 09:22:54",
 "affProTime": "2018-05-15 09:21:20",
 "shiComTime": "2018-05-15 11:23:39",
 "cancelTime": "",
 "demandVehicle": 100,
 "consignee": "asd",
 "consigneePhone": "asd",
 "goodsTime": null,
 "evaluateState": "01",
 "ownerId": "40284774635c4c4c01635d6a752b001e",
 "startPlace": "白山市 抚松县",
 "endPlace": "丹东市 凤城市",
 "demandModels": "普通挂车",
 "demandVehicleLength": "4.2米",
 "goodsType": "电子产品",
 "loadingTime": "2018-05-16 09:13:33",
 "driverPhone": "15102966484",
 "driveScore": 5,
 "driverHeadImage": null,
 "licPlateNum": "AH2345",
 "vehicleclassificationcode": "普通挂车",
 "carLength": "4.2米",
 "carLoad": "20",
 "ownerPhone": "13312345678",
 "ownerName": "asd",
 "ownerScore": 4,
 "ownerHeadImage": null,
 "ownerType": "货主",
 "freightPrepaidSum": "900.0",
 "freifhtTailedSum": "600.0",
 "otherExpensesSum": "30.0",
 "amount": "1530.0",
 "originCode": "220621",
 "destinationCode": "210682",
 "originLongitude": 127.449764,
 "originLatitude": 42.221208,
 "destinationLongitude": 124.066919,
 "destinationLatitude": 40.452298,
 "invoiceStatus": "03",
 "freightPrepaid": [ ],
 "freightTailed": [ ],
 "otherExpenses": [ ],
 "yfkyk": null,
 "yfkETC": null,
 "yfkxj": null,
 "driveName": "asd"
 
 
 */

///  获取货源列表
+ (void)qh_fetchOrdersWithParameters:(NSDictionary *)parameters success:(void(^)(BOOL status, NSNumber *code, NSString *message, NSArray<GQHOrderModel *> *orders))success failure:(void(^)(NSError *error))failure;

///  获取订单详情
+ (void)qh_fetchOrderDetailWithParameters:(NSDictionary *)parameters success:(void(^)(BOOL status, NSNumber *code, NSString *message, GQHOrderModel *order))success failure:(void(^)(NSError *error))failure;

@end
